package com.gitee.dupe.log.dto;

import com.gitee.dolt.utils.NumberUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

@Data
@Accessors(chain = true)
public class OptLogSaveDTO {

    @ApiModelProperty(value = "日志类型{OPT:操作类型;EX:异常类型}", allowableValues = "OPT,EX", required = true)
    @Length(max = NumberUtils.NUM_255)
    @NotBlank
    private String type;

    @ApiModelProperty(value = "操作模块", required = true)
    @Length(max = NumberUtils.NUM_255)
    @NotBlank
    private String optModule;

    @ApiModelProperty(value = "操作类型", required = true)
    @Length(max = NumberUtils.NUM_255)
    @NotBlank
    private String optType;

    @ApiModelProperty(value = "操作描述")
    @Length(max = NumberUtils.NUM_255)
    private String optDesc;

    @ApiModelProperty(value = "请求地址")
    @Length(max = NumberUtils.NUM_255)
    private String requestUri;

    @ApiModelProperty(value = "请求类型")
    @Length(max = NumberUtils.NUM_255)
    private String httpMethod;

    @ApiModelProperty(value = "请求参数")
    @Length(max = NumberUtils.NUM_65535)
    private String params;

    @ApiModelProperty(value = "业务id")
    @Length(max = NumberUtils.NUM_255)
    private String bizId;

    @ApiModelProperty(value = "日志来源")
    @Length(max = NumberUtils.NUM_255)
    private String source;
}
